package com.matt.repository;

import com.matt.domain.mp.WxUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface WxUserRepository extends JpaRepository<WxUser, String> , JpaSpecificationExecutor<WxUser> {

    @Query(value = "select u.* from wx_user u where u.parent_id in ?1", nativeQuery = true)
    List<WxUser> findByParentIdIn(String[] parentIds);

    List<WxUser> findByDefaultBaby(String childrenId);

}
